function addAudioPlay(url) {    
    var audio = document.getElementById('mv_player');
    if (!audio) {
        html = ['<div id="mv_player_sc" style="display:block;">'];
        html.push('<a href="#" class="mo-close"><i class="fa fa-close" onclick="return closeAudioPlay(this,event);"></i></a>');
        html.push('<audio id="mv_player" autoplay="autoplay" controls="controls" src="http://voicecdn-aliyun.xiaoludd.com/'+url+'"></audio>');
        html.push('</div>')
        $(document.body).append(html.join(''));  
        audio = document.getElementById('mv_player');      
    }else{
        audio.src="http://voicecdn-aliyun.xiaoludd.com/"+url;
    }

    audio.load();
}

function closeAudioPlay(sender,event){
    event.preventDefault();
    $(sender).parents('#mv_player_sc').hide();
    var audio = document.getElementById('mv_player');
    if(audio){
        audio.pause();
    }
}

/**
 * 禁止文本框的autocomplete,放在日志控件里出现遮挡选择
 */
function banAutoComplete(){
    $('.input-group-addon+.form-control').attr('autocomplete','off');
}


$(function(){   
    banAutoComplete();
});

/**
 * pjax成功返回的回调函数
 */
$('#pjax-container').on('pjax:success',function(){
    banAutoComplete();
});

if (lightbox) {
    lightbox.option({
        'resizeDuration': 0,
        fadeDuration: 0,
        imageFadeDuration: 0
    });
}
